package com.wits.comet.chat.entity;

import java.io.Serializable;

import javax.servlet.AsyncContext;

/**
 * 
 * @author Administrator
 *
 */
public class ChatMember implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1492376288805511687L;

	private String memberId;

	private String memberName;
	
	/** (tea或者stu) **/
	private String memberType;
	
	private AsyncContext asyncContext;
	
	private boolean online;
	
	
	/** 是否共享桌面(老师用户设置该属性,学生听课时检查该属性是否为true) **/
	private boolean shareDesktop;




	public ChatMember(){
		
	}
	
	public ChatMember(String memberId){
		this.memberId=memberId;
	}
	
	public ChatMember(String mId,String mName,String mType,AsyncContext ac,boolean shareDesktop){
		this.memberId=mId;
		this.memberName=mName;
		this.memberType=mType;
		this.asyncContext=ac;
		this.shareDesktop=shareDesktop;
	}
	
	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getMemberType() {
		return memberType;
	}

	public void setMemberType(String memberType) {
		this.memberType = memberType;
	}

	public AsyncContext getAsyncContext() {
		return asyncContext;
	}

	public void setAsyncContext(AsyncContext asyncContext) {
		this.asyncContext = asyncContext;
	}

	public boolean isOnline() {
		return online;
	}

	public void setOnline(boolean online) {
		this.online = online;
	}
	
	public boolean isShareDesktop() {
		return shareDesktop;
	}

	public void setShareDesktop(boolean shareDesktop) {
		this.shareDesktop = shareDesktop;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((memberId == null) ? 0 : memberId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChatMember other = (ChatMember) obj;
		if (memberId == null) {
			if (other.memberId != null)
				return false;
		} else if (!memberId.equals(other.memberId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "{memberId:\"" + this.memberId + "\",memberName:\""
				+this.memberName + "\"}";
	}
	

	
}
